import axios from "axios";

axios.interceptors.request.use(config=>{
    console.log("请求拦截")
    let token=sessionStorage.getItem("token")
    if (token){
        config.headers['token']=token
    }
    return config
})

axios.interceptors.response.use(config=>{
    console.log("*************接收回应***********")
    console.log(config.data)
    if(config.data=="203"){
        location.href="/"
    }
    return config
})
export default axios